package com.hongyun.tms.common.vo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.google.common.collect.Lists;
import com.hongyun.tms.common.annotation.Dict;
import com.hongyun.tms.common.annotation.excel.ExcelInfo;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 拖轮作业记录 响应
 *
 * @author liPeng
 * @date 2024-05-31
 **/
@Data
@ExcelInfo(fileName = "作业记录导出")
public class PordWorkVO implements Serializable {

    @ApiModelProperty(value = "主键")
    private Long id;

    @ApiModelProperty(value = "计划ID")
    private Long planId;


    @ApiModelProperty(value = "所属那条计划的状态")
    private Integer planStatus;

    @ApiModelProperty(value = "计划编号")
    private String planCode;


    @ApiModelProperty(value = "拖轮ID")
    private Long tugId;

    @ApiModelProperty(value = "拖轮编号")
    private String tugNo;

    @ApiModelProperty(value = "开始作业时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime beginTime;

    @ApiModelProperty(value = "结束作业时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime endTime;

    @ApiModelProperty(value = "作业项目ID")
    private Long workItemId;

    @ApiModelProperty(value = "作业项目")
    private String workItemName;

    @ApiModelProperty(value = "作业时长")
    private BigDecimal workHours;

    @ApiModelProperty(value = "客户ID")
    private Long customerId;

    @ApiModelProperty(value = "客户名称")
    @TableField("CUSTOMER_NAME")
    private String customerName;

    @ApiModelProperty(value = "船舶ID")
    @TableField("SHIP_ID")
    private Long shipId;

    @ApiModelProperty(value = "船名")
    @TableField("SHIP_NAME")
    private String shipName;

    @ApiModelProperty(value = "贸别：内贸，外贸")
    private String tradeType;

    @ApiModelProperty(value = "船舶类型代码")
    @Dict(code = "SHIP_KIND", fieldName = "shipKindName")
    private String shipKindCode;

    @ApiModelProperty(value = "拖轮费用")
    private BigDecimal amount;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "0未审核1已审核")
    private Integer status;

    @ApiModelProperty(value = "作业港区代码,字典")
    @Dict(code = "PORT_AREA", fieldName = "portAreaName")
    private String portAreaCode;

    @ApiModelProperty(value = "创建时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "更新时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime updateTime;

    @ApiModelProperty(value = "航次")
    private String voyage;

    @ApiModelProperty(value = "作业地点")
    private String workLocation;

    @ApiModelProperty(value = "油耗")
    private BigDecimal oilConsume;


    @ApiModelProperty(value = "行驶里程")
    private BigDecimal distance;

    //完工附件列表
    private List<Attach> attachList = Lists.newArrayList();

    @ApiModelProperty(value = "拖轮计费公式备注")
    private String calculateRemark;

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    @Builder(toBuilder = true)
    public static class Attach {
        private String url;
        private String fileId;
        private String businessType;
    }
}
